/*
 * @Author: 杜兜兜
 * @Date: 2025-03-03 13:39:10
 * @LastEditTime: 2025-04-03 14:26:19
 * @motto: Still water run deep
 * @Description: Modify here please
 * @FilePath: \hici_cloud_web\src\api\mes\wm\wmstock.js
 */
import request from "@/utils/request";

//add begin by zyj 2024/10/31
//库存列表 分页
export function list(query) {
  return request({
    url: "/mes/wm/warehouse/inventory/list",
    method: "get",
    params: query,
  });
}

//add end by zyj 2024/10/31

// 查询库存记录列表
export function listWmstock(query) {
  return request({
    url: "/mes/wm/wmstock/list",
    method: "get",
    params: query,
  });
}

// 查询库存记录详细
export function getWmstock(materialStockId) {
  return request({
    url: "/mes/wm/wmstock/" + materialStockId,
    method: "get",
  });
}
//数据同步
// export function synErpInventory() {
//   return request({
//     url: "/mes/wm/warehouse/inventory/synErpInventory",
//     method: "get",
//   });
// }
export function synErpInventory() {
  return request({
    url: "/sync/k3cloud/api/warehouseInventorySync/warehouseInventorySync",
    method: "get",
  });
}

// 新增库存记录
export function addWmstock(data) {
  return request({
    url: "/mes/wm/wmstock",
    method: "post",
    data: data,
  });
}

// 修改库存记录
export function updateWmstock(data) {
  return request({
    url: "/mes/wm/wmstock",
    method: "put",
    data: data,
  });
}

// 删除库存记录
export function delWmstock(materialStockId) {
  return request({
    url: "/mes/wm/wmstock/" + materialStockId,
    method: "delete",
  });
}
// 设置关键器件
export function itemkeySet(data) {
  return request({
    url: "/mes/wm/itemrecptline/itemkeySet",
    method: "post",
    data: data,
  });
}
//解绑
export function deleteKeyItem(itemCode) {
  return request({
    url: "/mes/wm/warehouse/inventory/" + itemCode,
    method: "delete",
  });
}
